package edu.lingnan.mapper;

import edu.lingnan.pojo.MyOrder;
import edu.lingnan.pojo.ProductOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Entity edu.lingnan.pojo.ProductOrder
 */
@Mapper
public interface ProductOrderMapper extends BaseMapper<ProductOrder> {

    @Delete("delete from product_order where order_id=#{id}")
    int deleteProductOrderByOrderId(Long id);


    void addProductOrder(@Param("order") MyOrder order, @Param("productId") Long productId);

    @Select("select count(*) from product_order where product_id=#{productId}")
    int selectProductOrderByProductId(Long productId);

    void updateProductOrderNumber(Long productId);

    List<ProductOrder> selectProductOrderByOrderIds(@Param("orderIdList") List<Long> orderIdList);



}




